VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmBasicGLToolGLActivity 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   7785
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   13785
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   7785
   ScaleWidth      =   13785
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmbAll 
      Caption         =   "Select &All"
      Height          =   360
      Left            =   255
      TabIndex        =   1
      Top             =   855
      Width           =   1215
   End
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "&Refresh"
      Height          =   375
      Left            =   255
      TabIndex        =   0
      Top             =   285
      Width           =   1215
   End
   Begin MSComctlLib.ListView lvwGLA 
      Height          =   5760
      Left            =   15
      TabIndex        =   2
      Top             =   1890
      Width           =   13545
      _ExtentX        =   23892
      _ExtentY        =   10160
      View            =   3
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      Checkboxes      =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   10
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "Posted"
         Object.Width           =   1411
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "Module Name"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "Date"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "Transaction No."
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "Account"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "Account Title"
         Object.Width           =   4410
      EndProperty
      BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Alignment       =   1
         SubItemIndex    =   6
         Text            =   "Debit"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Alignment       =   1
         SubItemIndex    =   7
         Text            =   "Credit"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   8
         Text            =   "Type"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   9
         Text            =   "Posted"
         Object.Width           =   0
      EndProperty
   End
   Begin ITGControls.ComunionFrames ComunionFrames1 
      Height          =   1815
      Left            =   1680
      Top             =   0
      Width           =   11730
      _ExtentX        =   20690
      _ExtentY        =   3201
      FrameColor      =   4210752
      BackColor       =   16243138
      FillColor       =   16243138
      RoundedCorner   =   0   'False
      Caption         =   "List Filter"
      Alignment       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ThemeColor      =   5
      ColorFrom       =   16243138
      ColorTo         =   16250865
      Begin VB.Frame fraListFilter 
         Appearance      =   0  'Flat
         BackColor       =   &H00F7D9C2&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   1260
         Left            =   7095
         TabIndex        =   6
         Top             =   450
         Width           =   1455
         Begin VB.OptionButton optUnposted 
            BackColor       =   &H00F7D9C2&
            Caption         =   "Unposted"
            Height          =   195
            Left            =   240
            TabIndex        =   9
            Top             =   660
            Width           =   1035
         End
         Begin VB.OptionButton optPosted 
            BackColor       =   &H00F7D9C2&
            Caption         =   "Posted"
            Height          =   330
            Left            =   240
            TabIndex        =   8
            Top             =   330
            Width           =   1035
         End
         Begin VB.OptionButton optListAll 
            BackColor       =   &H00F7D9C2&
            Caption         =   "All"
            Height          =   330
            Left            =   240
            TabIndex        =   7
            Top             =   60
            Value           =   -1  'True
            Width           =   1035
         End
      End
      Begin VB.CommandButton cmdShowList 
         BackColor       =   &H00F7D9C2&
         Caption         =   "&Show List"
         Height          =   375
         Left            =   9540
         TabIndex        =   5
         Top             =   705
         Width           =   1320
      End
      Begin VB.OptionButton optFilter 
         BackColor       =   &H00F7D9C2&
         Caption         =   "Filter by "
         Height          =   375
         Left            =   1095
         TabIndex        =   4
         Top             =   600
         Width           =   1035
      End
      Begin VB.OptionButton optAll 
         BackColor       =   &H00F7D9C2&
         Caption         =   "All"
         Height          =   255
         Left            =   315
         TabIndex        =   3
         Top             =   660
         Width           =   735
      End
      Begin ITGControls.ITGTextBox txtModule 
         Height          =   285
         Left            =   2460
         TabIndex        =   10
         Top             =   585
         Width           =   2040
         _ExtentX        =   3387
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   16243138
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   "Module :"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   800
         TextBoxWidth    =   1180
      End
      Begin ITGControls.ITGDateBox dtbFrom 
         Height          =   285
         Left            =   3255
         TabIndex        =   11
         Tag             =   "Order Date"
         Top             =   915
         Width           =   1275
         _ExtentX        =   2249
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
         Mandatory       =   -1  'True
      End
      Begin ITGControls.ITGDateBox dtbTo 
         Height          =   285
         Left            =   5145
         TabIndex        =   12
         Tag             =   "Order Date"
         Top             =   915
         Width           =   1275
         _ExtentX        =   2249
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
         Mandatory       =   -1  'True
      End
      Begin VB.Label Label2 
         BackColor       =   &H00F7D9C2&
         Caption         =   "From :"
         Height          =   225
         Left            =   2505
         TabIndex        =   14
         Top             =   975
         Width           =   645
      End
      Begin VB.Line Line1 
         X1              =   7080
         X2              =   7080
         Y1              =   435
         Y2              =   1800
      End
      Begin VB.Line Line2 
         X1              =   8640
         X2              =   8640
         Y1              =   435
         Y2              =   1800
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "To:"
         Height          =   195
         Left            =   4755
         TabIndex        =   13
         Top             =   1020
         Width           =   240
      End
   End
End
Attribute VB_Name = "frmBasicGLToolGLActivity"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IT Group Inc. 2005.09.23

Option Explicit

'Object variables


'Other declaration
Public sBit As String

Enum eBasicGLActList
    AllName
    UserName
    ModuleName
    DateRange
End Enum

Public mGLAList As eBasicGLActList

Private lLoaded As Boolean

Private connList As ADODB.Connection

'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cmbAll_Click()
Dim i As Integer
    If cmbAll.Caption = "Select &All" Then
        cmbAll.Caption = "Deselect &All"
        For i = 1 To lvwGLA.ListItems.Count
            lvwGLA.ListItems(i).Checked = True
        Next i
    Else
        cmbAll.Caption = "Select &All"
        For i = 1 To lvwGLA.ListItems.Count
            If Trim(lvwGLA.ListItems(i).SubItems(9)) = "0" Then lvwGLA.ListItems(i).Checked = False
        Next i
    End If
End Sub

Private Sub cmdRefresh_Click()
    cmdShowList_Click
End Sub

Private Sub cmdShowList_Click()
Dim sCondMod, sCondDate, sAll As String
If optAll.Value = False Then
    If Trim(txtModule) <> "" Then
        sCondMod = " AND cModule = '" & Trim(txtModule) & "' "
    Else
        sCondMod = ""
    End If
    If IsDate(dtbFrom.Text) Then
        If IsDate(dtbTo.Text) Then
            sCondDate = " AND dDate BETWEEN '" & Trim(dtbFrom.Text) & "' AND '" & Trim(dtbTo.Text) & "' "
        Else
            sCondDate = " AND dDate >= '" & Trim(dtbFrom.Text) & "' "
        End If
    Else
        If IsDate(dtbTo.Text) Then
            sCondDate = " AND dDate <= '" & Trim(dtbTo.Text) & "' "
        Else
            sCondDate = ""
        End If
    End If
    If optListAll.Value = True Then
        sAll = ""
    ElseIf optPosted.Value = True Then
        sAll = " AND lPosted = 1 "
    ElseIf optUnposted.Value = True Then
        sAll = " AND lPosted = 0 "
    End If
    LoadList sCondMod & sCondDate & sAll
Else
    LoadList
End If
End Sub

Private Sub Form_Activate()
    TBBitReload
    Set FrmName = Me
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

Private Sub Form_Load()
    
    Set FrmName = Me
    FormSetup

    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'BGL04'")
    
    lLoaded = True
    
    Me.dtbFrom.Text = Format(GetValueFrTable("cValue", "SYSTEM_OPTION", "cCode = 'MTDDATEFROM'"), "mm/dd/yyyy")
    Me.dtbTo.Text = Format(GetValueFrTable("cValue", "SYSTEM_OPTION", "cCode = 'MTDDATETO'"), "mm/dd/yyyy")
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , True, , , , , , , True
    BitVisible ITGLedgerMain.tbrMain, , True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True

End Sub

Private Sub Form_Resize()
'    If Not lLoaded Then Exit Sub
'    If Me.WindowState <> vbMinimized Then
'        If Me.Height < 1600 Then Me.Height = 1600
'        lvwGLA.Height = frmToolGLActivity.Height - 1600
'        lvwGLA.Width = frmToolGLActivity.Width - 120
'    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
'On Error Resume Next

    CloseMenuTab ITGLedgerMain
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
    
    
    lCloseWindow = True
    
    Set frmBasicGLToolGLActivity = Nothing
    
'    'oForm(Me.Tag).Mode = 1
'    'oForm(Me.Tag).Tag = Me.Tag
End Sub

Sub LoadList(Optional Condition As String)
    lvwGLA.ListItems.Clear
    If rs.State = adStateOpen Then rs.Close
    OpenNewConnection connList
    
    Select Case mGLAList
        Case AllName

            Caption = "General Ledger Activity"

            lvwGLA.ColumnHeaders(1).Width = "50"
            lvwGLA.ColumnHeaders(2).Width = "96"
            lvwGLA.ColumnHeaders(3).Width = "96"
            lvwGLA.ColumnHeaders(4).Width = "96"
            lvwGLA.ColumnHeaders(5).Width = "96"
            lvwGLA.ColumnHeaders(6).Width = "166"
            lvwGLA.ColumnHeaders(7).Width = "96"
            lvwGLA.ColumnHeaders(8).Width = "96"
            lvwGLA.ColumnHeaders(9).Width = "96"

            sSQL = "SELECT * FROM GLActivity WHERE cCompanyID = '" & COID & "' AND " & _
                    "(nDebit<>0 OR nCredit<>0) " & Condition & " ORDER BY dDate, cModule, cTranNo"

            rs.Open sSQL, connList, adOpenKeyset

            Do Until rs.EOF
                Set itmX = lvwGLA.ListItems.Add(, , " ")
                    itmX.SubItems(1) = Trim(rs!cModule)
                    itmX.SubItems(3) = Trim(rs!cTranNo)
                    itmX.SubItems(2) = Format(rs!dDate, "MM/dd/yyyy")
                    itmX.SubItems(4) = Trim(rs!cAcctNo)
                    itmX.SubItems(5) = Trim(rs!cTitle) & ""
                    itmX.SubItems(6) = Format(rs!nDebit, "###,###,##0.#0") & ""
                    itmX.SubItems(7) = Format(rs!nCredit, "###,###,##0.#0") & ""
                    itmX.SubItems(8) = Trim(rs!cTranCode) & ""
                    If rs!lPosted = True Then
                        itmX.Checked = True
                        itmX.SubItems(9) = "1"
                    Else
                        itmX.Checked = False
                        itmX.SubItems(9) = "0"
                    End If
                rs.MoveNext
            Loop

            Set rs = Nothing

        Case ModuleName
        Case UserName
    End Select
    Set connList = Nothing
End Sub

Private Sub lvwGLA_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
'    lvwGLA.Sorted = True
'    lvwGLA.SortKey = ColumnHeader.Index - 1
    lvwGLA.Sorted = True
    If lvwGLA.SortOrder = lvwAscending Then
        lvwGLA.SortOrder = lvwDescending
    Else
        lvwGLA.SortOrder = lvwAscending
    End If
    lvwGLA.SortKey = ColumnHeader.Index - 1
End Sub

Private Sub lvwGLA_DblClick()
Dim sModule As String
If lvwGLA.ListItems.Count = 0 Then Exit Sub

    Select Case Me.lvwGLA.SelectedItem.SubItems(1)
        Case "SI"
            Set FrmName = frmBasicARSalesInvoice
            sModule = "Sales Invoice"
        Case "VOU"
            Set FrmName = frmBasicAPVoucherMain
            sModule = "Check Voucher"
        Case "AR"
            Set FrmName = frmBasicARAdjustments
            sModule = "A/R Adjustments"
        Case "AP"
            Set FrmName = frmBasicAPAdjustments
            sModule = "A/P Adjustments"
        Case "PAY"
            Set FrmName = frmBasicAPSetup
            sModule = "Payables Setup"
        Case "OR"
            Set FrmName = frmBasicARCollection
            sModule = "Receipt"
        Case "FAD"
            Set FrmName = frmBasicGLFixedAssetDep
            sModule = "Fixed Assets Dep"
        Case "SOE"
            Set FrmName = frmBasicAPPMSEXPENSE
            sModule = "Summary Expense"
        Case "GL"
            Set FrmName = frmBasicGLJE
            sModule = "Journal Entry"
        Case "ACR"
            Set FrmName = frmBasicGLIntAR
            sModule = "Acknowledgment Receipt"
        Case "DP"
            Set FrmName = frmBasicARDepositSlip
            sModule = "Deposit Slip"
        Case "CLR"
            Set FrmName = frmBasicAPCheckClearing
            sModule = "Check Clearing"
              ' -------------------------NOT OK-------------------------
'        Case "DBM"
'            Set FrmName = frmGLDebit
'            sModule = "Debit Memo"
'        Case "CRM"
'            Set FrmName = frmGLCredit
'            sModule = "Credit Memo"
'        Case "DR"
'            Set FrmName = frmBasicMIDeliveryReceipt
'            sModule = "Delivery Receipt"
'        Case "WRR"
'            Set FrmName = frmAPWRR
'            sModule = "Receiving Report"

    End Select
    If (sModule & "") <> "" Then
        With FrmName
            If .Mode = 1 Then
                MsgBox "Sytem detected that '" & Trim(sModule) & "' is in Add/Edit mode." & _
                        vbCr & "Please save/undo the current transaction.", vbInformation + vbOKOnly, msgTtl
                FrmName.SetFocus
                Exit Sub
            Else
                ITGLedgerMain.MenuTab1.AddTab (GetValueFrTable("module_id", "erp_sec_modules", "link = '" & FrmName.Name & "'", True)), sModule, , FrmName.Name
                oContainer.SetUpContainer FrmName, True
'                .Show
                 .ZOrder
                  .WindowState = vbMaximized
                .ShowForm Trim(lvwGLA.SelectedItem.SubItems(3))
'                frmToolContainer.WindowState = vbMaximized
                
            End If
        End With
    End If
End Sub

Private Sub lvwGLA_ItemCheck(ByVal Item As MSComctlLib.ListItem)
    If Item.Checked = True Then
        CheckUncheck True, (Trim(Item.SubItems(1)) & Trim(Item.SubItems(3)))
    Else
        If Trim(Item.SubItems(9)) = "0" Then
            CheckUncheck False, (Trim(Item.SubItems(1)) & Trim(Item.SubItems(3)))
        Else
            Item.Checked = True
        End If
    End If
End Sub

Private Sub CheckUncheck(bval As Boolean, TranID As String)
    With lvwGLA
        For i = 1 To .ListItems.Count
            If (Trim(.ListItems(i).SubItems(1)) & Trim(.ListItems(i).SubItems(3))) = TranID Then
                .ListItems(i).Checked = bval
            End If
        Next i
    End With
End Sub

Private Sub optAll_Click()
    'LoadList
    cmbAll.Caption = "Select &All"
    txtModule.Enabled = False
    dtbFrom.Enabled = False
    dtbTo.Enabled = False
    cmdShowList.Enabled = True
    fraListFilter.Enabled = False
End Sub

Private Sub optFilter_Click()
    lvwGLA.ListItems.Clear
    cmbAll.Caption = "Select &All"
    txtModule.Enabled = True
    dtbFrom.Enabled = True
    dtbTo.Enabled = True
    cmdShowList.Enabled = True
    fraListFilter.Enabled = True
End Sub

Sub PostRecord()
Dim lOK As Boolean
On Error GoTo TheSource
    lOK = False
    cn.BeginTrans
    With lvwGLA
        For i = 1 To .ListItems.Count
            If .ListItems(i).Checked = True Then
                Select Case UCase(Trim(.ListItems(i).SubItems(1)))
                    Case "DR" 'DR
                        cn.Execute "UPDATE DR SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cDRNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "SI" 'Sales
                        cn.Execute "UPDATE SALES SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cInvNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "AR" 'AR Adjustments
                        cn.Execute "UPDATE AR SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "AP" 'AP Adjustments
                        cn.Execute "UPDATE AP SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "OR" 'Collection
                        cn.Execute "UPDATE PR SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "WRR" 'WRR
                        cn.Execute "UPDATE WRR SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cWRRNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "DP" 'Deposit
                        cn.Execute "UPDATE DEPOSIT SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "VOU" 'Voucher
                        cn.Execute "UPDATE VOUCHER SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                    Case "ACR" 'Acknowledgment Receipt
                        cn.Execute "UPDATE INTAR SET lPosted = 1 WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "'"
                End Select
                
                cn.Execute "UPDATE GLActivity SET lPosted = 1, dPosted = '" & Date & "' WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(.ListItems(i).SubItems(3)) & "' " & _
                        "AND cModule = '" & Trim(.ListItems(i).SubItems(1)) & "'"
            
            End If
        Next i
    End With
    cn.CommitTrans
    MsgBox "Posting successful.", vbExclamation, msgTtl
    lOK = True
TheSource:
    If Not lOK Then
        MsgBox "Posting failed! Error : " & err.Description, vbInformation, msgTtl
        cn.RollbackTrans
    End If
End Sub

'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, , True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Post current record
Public Sub TBPostRecord()
    PostRecord
End Sub

